Here's a new solution 1 for your "period" metric.